package com.example.eeuse.elasticsearch.model;

import lombok.Data;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexName;



/**
 * ES数据模型
 * <p>
 * Copyright © 2021 xpc1024 All Rights Reserved
 **/
@Data
@IndexName("document")
public class Document {
    private Document document;

    public Document() {

    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    /**
     * es中的唯一id
     */
    private String id;

    @Override
    public String toString() {
        return "Document{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }

    public Document(String title, String content) {
        this.title = title;
        this.content = content;
    }


    public Document(String id, String title, String content) {
        this.id = id;
        this.title = title;
        this.content = content;
    }

    /**
     * 文档标题
     */
    private String title;
    /**
     * 文档内容
     */

//    @HighLight(mappingField = "highlightContent")
//    private String content;


    @HighLight
    private String content;



//    private String highlightContent;


    private String contentText;

    public String getContentText() {
        return contentText;
    }

    public void setContentText(String contentText) {
        this.contentText = contentText;
    }
}
